def decorator(func):
    def wrapper(*args, **kwargs):
        print('start')
        func(*args, **kwargs)
        print('end')

    return wrapper


@decorator
def sleep(*args, **kwargs):
    print(f"参数：{args}, {kwargs}")
    import time
    import random
    print('睡眠中...')
    time.sleep(random.randint(1, 5))


if __name__ == '__main__':
    # proxy = decorator(sleep)
    # proxy()
    sleep(1, 2, 3, name='张三', age=18)
